package com.kedou.sdk.params.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.kedou.sdk.content.IActivityContent;

public class ActivityInfo implements IActivityContent, Parcelable {

    @SerializedName("is_end")
    private int closure;

    @SerializedName("article_id")
    private String articleId;

    @SerializedName("title")
    private String title;

    @SerializedName("thumb")
    private String thumb;

    @SerializedName("detail_url")
    private String detailUrl;

    @Override
    public String getActivityTitle() {
        return title;
    }

    @Override
    public String getActivityImageUrl() {
        return thumb;
    }

    @Override
    public String getActivityDetailUrl() {
        return detailUrl;
    }

    @Override
    public boolean isActivityClosure() {
        return closure != 0;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.closure);
        dest.writeString(this.articleId);
        dest.writeString(this.title);
        dest.writeString(this.thumb);
        dest.writeString(this.detailUrl);
    }

    public ActivityInfo() {
    }

    protected ActivityInfo(Parcel in) {
        this.closure = in.readInt();
        this.articleId = in.readString();
        this.title = in.readString();
        this.thumb = in.readString();
        this.detailUrl = in.readString();
    }

    public static final Creator<ActivityInfo> CREATOR = new Creator<ActivityInfo>() {
        @Override
        public ActivityInfo createFromParcel(Parcel source) {
            return new ActivityInfo(source);
        }

        @Override
        public ActivityInfo[] newArray(int size) {
            return new ActivityInfo[size];
        }
    };
}
